package com.fxx.face.http.inteface;


import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HEAD;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * @ProjectName: HttpRequestLibs
 * @Package: com.fxx.http.libs.common
 * @ClassName: ReqeustApi
 * @Description: 请求API
 * @Author: 付小歆
 * @CreateDate: 2021/12/9 15:45
 */
public interface RequestApi {

    /**
     * 获取token
     * @param grant_type
     * @param client_id
     * @param client_secret
     * @return
     */
    @GET("oauth/2.0/token")
    Observable<ResponseBody> getToken(@Query("grant_type") String grant_type,
                                      @Query("client_id") String client_id,
                                      @Query("client_secret") String client_secret);

    /**
     * 验证人脸/搜索人脸
     */
    @FormUrlEncoded
    @POST("rest/2.0/face/v3/search")
    Observable<ResponseBody> verifyFace(@FieldMap Map<String,String> map,
                                        @Header("Content-Type") String header);

    /**
     * 注册人脸
     */
    @FormUrlEncoded
    @POST("rest/2.0/face/v3/faceset/user/add")
    Observable<ResponseBody> registerFace(@FieldMap Map<String,String> map,
                                          @Header("Content-Type") String header);

    /**
     * 删除人脸
     */
    @FormUrlEncoded
    @POST("rest/2.0/face/v3/faceset/face/delete")
    Observable<ResponseBody> deleteFace(@FieldMap Map<String,String> map,
                                        @Header("Content-Type") String header);

    /**
     * 更新人脸
     * @param map
     * @param header
     * @return
     */
    @FormUrlEncoded
    @POST("rest/2.0/face/v3/faceset/user/update")
    Observable<ResponseBody> updateFace(@FieldMap Map<String,String> map,
                                        @Header("Content-Type") String header);

}
